package com.sunburst.demo.utils;

import java.time.Duration;

/**
 * 线程工具类
 *
 */
public class ThreadUtils {

    /**
     * 休眠等待
     *
     * @param duration
     */
    public static void sleep(Duration duration) {
        try {
            Thread.sleep(duration.toMillis());
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }

}
